import {request} from "@/utils/request";
import {getToken} from "@/utils/storage";

export function list() {
    return request({
        url:`/api/classSchedule/list`,
        method: "get",
        headers: {"token": getToken()}
    })
}

export function remove(id) {
    return request({
        url:`/api/classSchedule/remove/${id}`,
        method: "delete",
        headers: {"token": getToken()}
    })
}

export function save(data) {

    return request({
        url:`/api/classSchedule/save`,
        method: "post",
        headers: {"token": getToken()},
        data: {
            "name": data.name,
            "gradeId": data.gradeId,
            "roomId": data.roomId,
            "startTime": data.startTime,
            "endTime": data.endTime
        }
    })
}
